import re

# 定义手机号
phone_num1 = "18203987777"
phone_num2 = "18203956556587777"

# 使用re模块进行匹配
regex = "[1][0-9]{10}$"
matcher = re.match(regex, phone_num1)
# TypeError: expected string or bytes-like object
# 正则表达式匹配的必须字符串
print(matcher)
# 判断
if matcher is not None:
    print("手机号是合格的！！！")
    # 获取结果
    # print(matcher.group())
    result = matcher.group()
    print(f"匹配到的结果为：{result}")
else:
    print(f"{phone_num1}不是标准格式的手机号")
